UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YOzo54+rDfuhwMhw6J1GuQahJdQIPeKMZAHQkWwzB9g='
WHERE
key_id = 'f32e2f36a6df0de76cf83cde95ef74ffa8b2d2f41ac97db68e2dc1bbb12fd0a3'
AND (
token = 'YOzo54+rDfuhwMhw6J1GuQahJdQIPeKMZAHQkWwzB9g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)