UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r1TR0hVLRw5wxch0bng/DWxAMgE+J6OPZFjHN63KsOI='
WHERE
key_id = '71350bba0e53821dca3c8a040b879d33bf4ad033e22a58994a844bf19cf8a948'
AND (
token = 'r1TR0hVLRw5wxch0bng/DWxAMgE+J6OPZFjHN63KsOI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)