UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/oWm2hL3LiwWeRyGxYKrbPWZMvLI6xCUVFcH4LbQPL4='
WHERE
key_id = '11844733e0f8f16a5c276eb69d85bc4f41eeadf7baa775ea6167b874080c8345'
AND (
token = '/oWm2hL3LiwWeRyGxYKrbPWZMvLI6xCUVFcH4LbQPL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)