UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hb3qfT60gAh0MbaFKiPEFQ2sjMyenaQol+WZBfBQtB8='
WHERE
key_id = '4caf9a759127dd2fa9c8d897e2ccf82447c4288b870f8292ed346fdb97acadf9'
AND (
token = 'hb3qfT60gAh0MbaFKiPEFQ2sjMyenaQol+WZBfBQtB8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)