UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XPyjg0Chb/Sxg5I3nXdiRSrVKe0AmOJnLkE468DyqxY='
WHERE
key_id = 'ef4ab90fdcaed5d4ae7d099a31be2fa170b8c2063c0a8d0cab2d5b167137449e'
AND (
token = 'XPyjg0Chb/Sxg5I3nXdiRSrVKe0AmOJnLkE468DyqxY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)