UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0B4rudfb/CtM7Ar6VCzchQQQBT8JsOnaRk03CJVe3vY='
WHERE
key_id = '8db8f725de63351b2f6366cdbb51c469ce5a93c10ddf80e22873344e6a607a20'
AND (
token = '0B4rudfb/CtM7Ar6VCzchQQQBT8JsOnaRk03CJVe3vY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)