UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iBooo+df8TLFAINMQC1+qanOLyO/bQ2rShqKxSlkLHE='
WHERE
key_id = '57fb4f48d1daf3b3cded1f68c5ae7e79ac38343bd6e417e6ab4f2979c537efbf'
AND (
token = 'iBooo+df8TLFAINMQC1+qanOLyO/bQ2rShqKxSlkLHE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)