UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DpeIA5RVx9p3kygBdnF40dCzEBiMegQaKNmFBdLFn8k='
WHERE
key_id = 'a274a65cc8e853752fafc87a6b16bc61120c07273b398edbb8202788eeb6b06e'
AND (
token = 'DpeIA5RVx9p3kygBdnF40dCzEBiMegQaKNmFBdLFn8k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)