UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rlTz5RZDie1XrpdbhypsTh9fIVfXJqeDFL08BiPaLSo=' 
WHERE 
  key_id = '2aee6b2d660d8a517ecdf4ba4118edbf885bfa02b1c5a0d2cbbfc1a103df9c50' 
  AND (
    token = 'rlTz5RZDie1XrpdbhypsTh9fIVfXJqeDFL08BiPaLSo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033