UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RIbNTg3o/bZvuNkEJugwKTjlAFXPdctZbsyqLNmb7Xc='
WHERE
key_id = '777ac3658258fb069e062c1874fcff3aa1754cb8de60ac181a7b92623b78c045'
AND (
token = 'RIbNTg3o/bZvuNkEJugwKTjlAFXPdctZbsyqLNmb7Xc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)