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