UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bhMMekftzUGiTYbY+CT6WYpLVuuDCNVe1V2urTMVaGA='
WHERE
key_id = 'e6bdad04f1517f6070369bc76b4093cb7d63224f5eb5f8b293966a1fd6fc0938'
AND (
token = 'bhMMekftzUGiTYbY+CT6WYpLVuuDCNVe1V2urTMVaGA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)