UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l2TI7LQF+D08KOty2bgsYDSJO31lTBHNPrRM096MyLo='
WHERE
key_id = 'f664fada86c7fa9d8ee3c0d20673e1d390d17fa16eb69a20c21467505e0dfaa1'
AND (
token = 'l2TI7LQF+D08KOty2bgsYDSJO31lTBHNPrRM096MyLo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)