UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WJQUc1rr7FQKxECK/Dk3tYKh131Pm1nl9Hok2bc8lYc=' 
WHERE 
  key_id = '19b5f03f08ac141edd4a8a6a7ebc1a933d464d6bdf70fee0adbc2e1d3f3b5957' 
  AND (
    token = 'WJQUc1rr7FQKxECK/Dk3tYKh131Pm1nl9Hok2bc8lYc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047