UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OT2fcehkUX2fU5+8CjvwI9AppE/3DWhSvqpZ6/mqfM0='
WHERE
key_id = '651742fbde23de4b6c85a2c96babeb9ff4ddf1c447e68c45cf44aef5589e1bd5'
AND (
token = 'OT2fcehkUX2fU5+8CjvwI9AppE/3DWhSvqpZ6/mqfM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)