UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Rbamw0qowr5pklkpxZbAK5/vt2xU8gOSiRVrzQ8PoE='
WHERE
key_id = '35938cb5f8820951ab0d19e2150382e7ba48db3336922c8396c11def04a1e619'
AND (
token = '+Rbamw0qowr5pklkpxZbAK5/vt2xU8gOSiRVrzQ8PoE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)