UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k4zVOORVZmuSGkKlhu8SpWF2fLZeT18GANQJfhBG0Cw='
WHERE
key_id = '234203165a0fddecd999ac99529839c3d8db8ad01d3ec8cc0987258ea8679148'
AND (
token = 'k4zVOORVZmuSGkKlhu8SpWF2fLZeT18GANQJfhBG0Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)