UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ixiDtkvrKMzy6g/ad00Hv0ri4BqGiukTgWkmQvdUKf4='
WHERE
key_id = '2bc0aeef03948ff39d71774df38d89d88dd566c7f81fd68bfc81ed4b2300deae'
AND (
token = 'ixiDtkvrKMzy6g/ad00Hv0ri4BqGiukTgWkmQvdUKf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)