UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GJxjeLDkJ+/xG+FAtIaAlDgLtfFT1lpF99efFa9ufDo=' 
WHERE 
  key_id = 'd21620a7024c7c68633f8d8b3ce142f0225c29d5da999e8832899b2b17d88e69' 
  AND (
    token = 'GJxjeLDkJ+/xG+FAtIaAlDgLtfFT1lpF99efFa9ufDo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041