UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CcmQy7LV5izXydMJ7zAtIBdXfAADtweZzDQxgImJAAM='
WHERE
key_id = '38a2fe0221b6c115f6a3c2f472bc94ae75b8d25bfef5f5e0f3372f13853c69a1'
AND (
token = 'CcmQy7LV5izXydMJ7zAtIBdXfAADtweZzDQxgImJAAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)