UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZVmEw+9/fhKaazaTlzQkFYMDBuCGsEI+QudEvY6x69o=' 
WHERE 
  key_id = '5cb2bdb088df01219cfbe493cd00f19900312d497059b66e4552a5c7f60d575d' 
  AND (
    token = 'ZVmEw+9/fhKaazaTlzQkFYMDBuCGsEI+QudEvY6x69o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033