UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '51LvRCDG0PlgiGgMesdRNk3++0VuplKQDu70k97aI/Q='
WHERE
key_id = 'f2a576b59f4acd8732840e82c6eb5ec5bbd70fd39fed91c9d255e341f1615f2e'
AND (
token = '51LvRCDG0PlgiGgMesdRNk3++0VuplKQDu70k97aI/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)