UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dmsLMHdnEKrDQJaj8sSh4AHi9eBuGOyPtZpHQwxDanU='
WHERE
key_id = '3f227cc95fd6bd777cca4dc2dee8f24cd21d6e2c7ce6d408b35e3f03954d6d52'
AND (
token = 'dmsLMHdnEKrDQJaj8sSh4AHi9eBuGOyPtZpHQwxDanU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)