UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EkHwl3Z71wXPej7T4cyJzvS4l6Nro397mTUKJqqHM8w='
WHERE
key_id = 'ea711f8a8c72534d6a540fcc69d4327a8ad9a6dd272fbc43df1d6ceeca44bd24'
AND (
token = 'EkHwl3Z71wXPej7T4cyJzvS4l6Nro397mTUKJqqHM8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)