UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cCb/+qGOXN378Tfe9f5Nw8/jNiSDH+mLLfof5EuwruQ='
WHERE
key_id = '0837b63db7b7ab2d5725518891d4c04327171399f079fed3cf752aca7d5bb296'
AND (
token = 'cCb/+qGOXN378Tfe9f5Nw8/jNiSDH+mLLfof5EuwruQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)