UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FqfD6lIkrgsqQjI6P9blRu7k0R5jOv0QLrOVD6HOs3E='
WHERE
key_id = '423ec898f455240ad8ef55ac61a3fb8dae0de803cca7b1f54fb694812b7ba9cc'
AND (
token = 'FqfD6lIkrgsqQjI6P9blRu7k0R5jOv0QLrOVD6HOs3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)