UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kurwosKBihqnUNgLiHRNQV+lt71Jwp4rkDEyG/Po54s=' 
WHERE 
  key_id = '8a7ebfc50f6bd656d2bd6168ce4c728d66ba0dca51612a75ea1885139036b441' 
  AND (
    token = 'kurwosKBihqnUNgLiHRNQV+lt71Jwp4rkDEyG/Po54s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034