UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D89v6XqkGtVFLbsGSaVkXJTOcIm/nGtRTvDEuKyjtB0='
WHERE
key_id = 'ef6fdf988d586443488f7157c6ace035330a9dbbaf5541f9e26f38d80ee8c6ff'
AND (
token = 'D89v6XqkGtVFLbsGSaVkXJTOcIm/nGtRTvDEuKyjtB0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)