UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RS/K/4b25HGqtBF2Xu1tPrbk0UzyPYUyBFL1VO4k4I8='
WHERE
key_id = 'aae08828c8c5847527da88c706746d38ba0a7bc55207e8dfea3403b6b25ddc8d'
AND (
token = 'RS/K/4b25HGqtBF2Xu1tPrbk0UzyPYUyBFL1VO4k4I8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)